<?php

declare(strict_types=1);
/**
 * This file is part of habo_new_media.
 *
 * @link     https://www.berlen.cn/
 * @contact  tech@berlen.cn
 * @license  http://gitlab.rehou.cn/habo/habo_new_media/-/blob/master/README.md
 */

namespace app\service\batch\ocean;

use app\model\mongo\MongoOeVideoModel;
use app\service\fetch\MediaInterface;
use app\service\fetch\MediaService;

final class MongoVideoStatusService extends MediaService implements MediaInterface
{
    /**
     * 修改视频删除状态.
     * @param int $accountId 账户表id
     * @param int $version 版本号日期
     * @return true
     */
    public static function setMongoVideoStatus(int $accountId = 0, int $version = 0): bool
    {
        (new MongoOeVideoModel())
            ->where('version', '<', $version)
            ->where('account_id', $accountId)
            ->update(['is_delete' => 1]);
        return true;
    }
}
